import cv2
import numpy as np

img = np.zeros((300, 640), dtype=np.uint8)
k1 = 1.5
k2 = -1.5
b1 = -270
b2 = 690

p1, p2, p3, p4 = [0, 0], [0, 0], [0, 0], [0, 0]

p1[1] = int(- b1 / k1)
p2[1] = int((300 - b1) / k1)
p3[1] = int(- b2 / k2)
p4[1] = int((300 - b2) / k2)
cv2.line(img, (p1[0], p1[1]), (p2[0], p2[1]), (255, 0, 0), 2)
cv2.imshow("r", cv2.cvtColor(img, cv2.COLOR_GRAY2BGR))
cv2.waitKey(0)
cv2.destroyAllWindows()
